package com.jiang.annotation.aop.log_exec;

import com.jiang.annotation.aop.log_exec.entity.Order;
import com.jiang.annotation.aop.log_exec.entity.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/logExec")
public class LogExecController {

    @GetMapping("test1")
    @LogExecution(entityClass = Order.class, ServiceClass = OrderService.class, method = "save")
    public String test1( @RequestParam("cost") double cost, @RequestParam("name") String name){
        return String.format("name: %s, cost: %s", name, cost);
    }
}
